package com.sp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

@RestController
@RequestMapping("/upload")
public class UploadController {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @RequestMapping("/file")
    public String file(@RequestParam Map map, @RequestParam("file") MultipartFile file) {
        System.out.println(map);
//        System.out.println(file.getName());
        return "请求成功";
    }

    @RequestMapping("/file2")
    public String file2(@RequestBody Map map, @RequestParam("file") MultipartFile file) {
        System.out.println(map);
//        System.out.println(file.getName());
        return "请求成功";
    }
}
